<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			function calc(){
				var u=document.getElementById("books").firstElementChild;
				var lis=u.children;
				alert(lis.length);
				var str="";
				for(var i=0;i<lis.length;i++){
					alert(i+"-"+lis[i].innerHTML);
					///alert(lis[i].children.length);
					str+=lis[i].children[0].innerHTML;
					str+=" "+lis[i].children[3].innerHTML;
					str+="<br/>";
					
				}
				alert(str);
			}
			function delBook222(bid){
				document.getElementById(bid).remove();
			}
			function delBook(t){
				//t指代a
				t.parentNode.remove();
			}
		</script>
	</head>
	<body>
		<div id="books">
			<ul>
				<li id="d1">
					<span>西游记</span> 
					<span>21.9</span>
					<input type="number" min="1"/>
					<span>21.9</span>
					<a href="#" onclick="delBook(this)">删除</a>
				</li>
				<li  id="d2">
					<span>岛上书店</span> 
					<span>29</span>
					<input type="number" min="1"/>
					<span>29</span>
					<a href="#" onclick="delBook(this)">删除</a>
				</li>
				<li  id="d3">
					<span>红床梦</span> 
					<span>29</span>
					<input type="number" min="1"/>
					<span>29</span>
					<a href="#" onclick="delBook(this)">删除</a>
				</li>
				<li  id="d4">
					<span>水浒专</span> 
					<span>29</span>
					<input type="number" min="1"/>
					<span>29</span>
					<a href="#" onclick="delBook(this)">删除</a>
				</li>
				<!--this-->
			</ul>
		</div>
		<p>
			<input type="button" value="结算" onclick="calc()"/>
		</p>
	</body>
</html>
